<?php
  include_once($_SERVER['DOCUMENT_ROOT']."ExiaStore/Model/Articles/catalogue.php"); //Permet d'utiliser la classe catalogue
    
    $catalogue = new catalogue(); //Instancie un nouveau catalogue
    $catalogue->getNouveaute(); //Recupère la liste des nouveauté
    $articles = $catalogue->getArticles(); //Renvoie le tableau des articles
    
    $catalogueTop = new catalogue();
    $catalogueTop->getMeilleuresVentes(); //Recupère les meilleures ventes
    $topVentes = $catalogueTop->getArticles(); //Renvoie le tableau des articles

?>



<?php
include("../Controller/redirection.php");
?>
    

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="shortcut icon" href="../../assets/ico/favicon.ico">

    <title>Catalogue-Admin</title>

    <!-- Bootstrap core CSS -->
    <link href="../bootstrap/css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="offcanvas.css" rel="stylesheet">

    <!-- Just for debugging purposes. Don't actually copy this line! -->
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>

  <body style="background-color: rgb(180,180,180)">
       


    <div class="container">

        <?php  
    include ("navbarAdmin.php");  
    ?>
        
        </br>
        </br>
        </br>
       
          <?php foreach($articles as $val){ ?>
        
          
            <div class="col-3 col-sm-4 col-lg-3"id="article">
              <h2><?php echo $val->getNomArticle(); ?></h2>
              
              
              <form action="../Controller/supprimerArticle.php" method="get">
              <p><?php echo  $val->getPrix() . "€";?> 
                  <input name="id" type="text"<?php echo " value='".$val->getIDArticle()."' "; ?> style="float:right;visibility:hidden"></p>  
              <p><?php echo "<img src='".$val->getPhoto()."' class='image2'"; ?>
               
                      
              </p>
              
                 <div class="row">
                     <div class="col-lg-3 ">
              
              
              <button type="submit" class="btn btn-default" role="button">Supprimer &raquo</button>
              
              
              </div>
                <div class="col-lg-3 col-lg-offset-1">
                    <?php if(!empty($_SESSION['login'])){
                    echo "<p><a class='btn btn-default' href='#' role='button'>Modifier &raquo;</a></p>";} ?>
                </div>
                  </div>
            </div><!--/span-->
          
          <?php } ?>
           </div>
        </div>

        
      </div><!--/row-->

      <hr>

      <footer>
        <p> ExiaStore 2014</p>
      </footer>

    </div><!--/.container-->



    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
    <script src="../bootstrap/js/bootstrap.min.js"></script>
    <script src="offcanvas.js"></script>
  </body>
</html>